package iterator;

import iterator.actors.BookShelf;
import iterator.extras.Book;
import iterator.roles.Iterator;

public class Main {
    public static void main(String[] args){
        BookShelf bookShelf = new BookShelf(4);
        bookShelf.appendBook(new Book("Java核心技术卷1"));
        bookShelf.appendBook(new Book("Java核心技术卷2"));
        bookShelf.appendBook(new Book("Spring实战"));
        bookShelf.appendBook(new Book("SpringBoot实战"));
        Iterator it = bookShelf.iterator();
        while(it.hasNext()){
            Book book = (Book) it.next();
            System.out.println(book.getName());
        }
    }
}
